#include<iostream>
#include<memory>
#include"Socket.hpp"
#include"Log.hpp"

using namespace LogModule;
using namespace SocketModule;

class Listen 
{
    public:
    Listen(int port)
    :_listensock(std::make_unique<TcpSocket>())
    ,_port(port)
    {
        _listensock->BuildTcpSocketMethod(_port);
    }
    void Accpte()
    {
        std::cout<<"建立了链接"<<std::endl;

    }
    int  GetSockfd()
    {
        return _listensock->Fd();
    }
    ~Listen()
    {
        _listensock->Close();
    }
    private:
    std::unique_ptr<Socket> _listensock;
    int _port; 
};